import Api from '@/api/payment/currency'
import i18n from "@/lang/index";
const modalConfig = {
  pageName: "sys:user",
  dialog: {
    title: i18n.global.t("title.16"),
    width: 800,
    appendToBody: true,
    draggable: true,
    labelWidth: "auto",
  },
  formAction: (data) => {
    console.log("add", data);
    return new Promise((resolve, reject) => {
      Api.add(data).then(s => {
        console.log(s);
        resolve(s)
      }).catch(e => {
        reject(e)
      })
    });
  },
  formItems: [
    {
      type: "input",
      label: i18n.global.t("form.52"),
      prop: "code",
      attrs: {
        placeholder: i18n.global.t("hint.76"),
      },
    },
    {
      type: "upload",
      label: i18n.global.t("form.53"),
      prop: "image",
      attrs: {
        placeholder: i18n.global.t("hint.77"),
      },
    },
    {
      type: "input",
      label: i18n.global.t("form.54"),
      prop: "symbol",
      attrs: {
        placeholder: i18n.global.t("hint.78"),
      },
    },
  ],
  formRules: {
    code: [{ required: true, message: i18n.global.t("hint.76"), trigger: "blur" }],
    image: [{ required: true, message: i18n.global.t("hint.77"), trigger: "blur" }],
    symbol: [{ required: true, message: i18n.global.t("hint.78"), trigger: "blur" }],
  },
};

export default modalConfig;
